< previous page page_477 next page >

Page 477
Type.gifListing 12.13. Coding the UserControl_ReadProperties event.
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    '
    ' get design-time vars
    '
    With PropBag
        strDBName = .ReadProperty("DatabaseName", "")
        strConnect = .ReadProperty("Connect", "")
        strRSName = .ReadProperty("RecordSource", "")
        strListField = .ReadProperty("ListField", "")
        strBoundColumn = .ReadProperty("BoundColumn", "")
    End With
    '
End Sub
The Initialize and Resize events can be used to set and adjust the size of the control. Enter the code from Listing 12.14 into the Initialize and Resize events of the User control.
Type.gifListing 12.14. Coding the Initialize and Resize events of the User control.
Private Sub UserControl_Initialize()
    '
    ' set default size
    '
    UserControl.Height = 315
    UserControl.Width = 315
    '
End Sub

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    '
    ' get design-time vars
    '
    With PropBag
        strDBName = .ReadProperty("DatabaseName", "")
        strConnect = .ReadProperty("Connect", "")
        strRSName = .ReadProperty("RecordSource", "")
        strListField = .ReadProperty("ListField", "")
        strBoundColumn = .ReadProperty("BoundColumn", "")
    End With
    '
End Sub
continues

 
< previous page page_477 next page >

If you like this book, buy it!